package fi.foyt.cs.persistence.domainmodel.user;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

import com.beoui.geocell.annotations.Geocells;
import com.beoui.geocell.annotations.Latitude;
import com.beoui.geocell.annotations.Longitude;
import com.google.appengine.api.datastore.Key;

@Entity
public class UserLocation {

  public Key getId() {
    return id;
  }

  public Long getUserId() {
    return userId;
  }

  public void setUserId(Long userId) {
    this.userId = userId;
  }
  
  public List<String> getGeocells() {
    return geocells;
  }
  
  public void setGeocells(List<String> geocells) {
    this.geocells = geocells;
  }
  
  public double getLatitude() {
    return latitude;
  }
  
  public void setLatitude(double latitude) {
    this.latitude = latitude;
  }
  
  public double getLongitude() {
    return longitude;
  }
  
  public void setLongitude(double longitude) {
    this.longitude = longitude;
  }
  
  public Long getUpdated() {
    return updated;
  }
  
  public void setUpdated(Long updated) {
    this.updated = updated;
  }

  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Key id;

  @Column(nullable = false)
  private Long userId;

  @Column(nullable = false)
  @Latitude
  private double latitude;

  @Column(nullable = false)
  @Longitude
  private double longitude;

  @Column(nullable = false)
  private Long updated;

  @Column(nullable = false)
  @Geocells
  private List<String> geocells;
}
